﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SeaBattle.UI.Web.Models;
using SeaBattle.Domain.Abstract.Services;
using SeaBattle.Domain.Abstract;

namespace SeaBattle.UI.Web.Controllers
{
   [Authorize]
    public class ProfileController : Controller
    {
        //
        // GET: /ProfileView/

       IPlayerRepository playerRepository;

       public ProfileController(IPlayerRepository playerRepository)
       {
           this.playerRepository = playerRepository;

       }
       
       public ActionResult Index(string login)
        {
            //var playerService = PlayerFactory.CreatePlayerService();
            var player = playerRepository.GetPlayer(login);


            return View(new ProfileViewModel {Player = player });
        }

    }
}
